package repeat.personal.exception;


import repeat.personal.constants.HttpStatus;

/**
 * @Author Zhanggq
 * @Date 2019/5/13 15:35
 * @Version 1.0
 */
public enum CodeMsg {

    //通用的模块
    SUCCESS(HttpStatus.SC_OK, "OK"),
    BAD_REQUEST(HttpStatus.SC_BAD_REQUEST, "Bad Request"),
    NOT_FOUND(HttpStatus.SC_NOT_FOUND, "Not Found"),
    INTERNAL_SERVER_ERROR(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Unknown Internal Error"),
    NOT_VALID_PARAM(HttpStatus.SC_BAD_REQUEST, "Not valid Params"),


    //机构管理模块 500XXX
    EXIST_NORMAL_USER(500000,"该部门还有正常用户，请先处理"),
    EXIST_NORMAL_ROLE(500001,"该部门还有正常角色，请先处理"),
    EXIST_NORMAL_DEPT(500002,"该部门还有正常子部门，请先处理"),
    EXIST_DEPT(500003,"机构已存在！"),


    //用户模块
    EXIST_USER(5001000,"用户已存在！"),

    //角色模块
    ADMIN_UNMODIFIABLE(5002001,"超级管理员不允许修改！"),
    EXIST_ROLE(5002002,"角色已存在！"),
    ROLE_EXIST_NORMAL_USER(5002003,"该角色存在着正常用户，请先处理"),

    //菜单模块
    EXIST_MENU(5003000,"菜单已存在！"),
    EXIST_SUBMENU(5003001,"存在子菜单，请先处理"),

    //字典模块
    EXIST_DICT(5004000,"该类型字典已存在！");

    private int code;
    private String message;

    CodeMsg(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
